class MyArray<T> {
    Object[] array = new Object[10];
    public void setValue(int pos,T val) {
        array[pos] = val;
    }
    public T getValue(int pos) {
        return (T)array[pos];
    }
}

class Fun<T extends Comparable<T>> {
    public T maxValue(T []array) {
        T maxval = array[0];
        for(int i=0;i<array.length;i++) {
            if(maxval.compareTo(array[i])<0) {
                maxval = array[i];
            }
        }
        return (T)maxval;
    }
}
public class Test {
    public static void main1(String[] args) {
        Integer[] array = {1,2,3,4,5,6};
        Fun<Integer> fun = new Fun<>();
        int maxval = fun.maxValue(array);
        System.out.println(maxval);
    }
}
